﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace com.ytocargo.Core.BackgroundJobInfos
{
    public interface IBackgroundJobInfoStore
    {
        Task<List<BackgroundJobInfo>> GetWaitingJobsAsync(int maxCount);

        Task<BackgroundJobInfo> UpdateAsync(BackgroundJobInfo jobInfo);

        Task DeleteAsync(BackgroundJobInfo jobInfo);

        Task InsertAsync(BackgroundJobInfo jobInfo);

        void Insert(BackgroundJobInfo jobInfo);

        IQueryable<BackgroundJobInfo> GetAll();

        Task<List<BackgroundJobInfo>> GetListByPredicate(Expression<Func<BackgroundJobInfo, bool>> expression);

        Task<int> CountByPredicate(Expression<Func<BackgroundJobInfo, bool>> expression);

    }
}
